<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Articles extends CI_Controller {
	function __controller() {
		parent::Controller();
	}

	public function index($url = 'def') {

		$this -> load -> model('Views_modul', 'views');

		$this -> views -> title = 'Статьи о недвижимости';
		$this -> views -> menu = 'article';
		
		$this -> views -> content = $this -> load -> view('pages/articles/def', '', TRUE);
		$content = $this -> views -> request_view();
		$this -> load -> view('home', $content);

	}

	public function ident($id = 0) {

		$this -> load -> model('Views_modul', 'views');

		$this -> load -> model('Articles_modul', 'articles');

		#   $content['rubrics'] = $this -> news -> rubrics();

		$article = $this -> articles -> newsid($id);

		$this -> views -> title = $article['title'];

		# Получаем похожие новости

		
		$this -> views -> pathway = $this -> load -> view('articles/menu_pathway', '', true);

		$this -> views -> content = $this -> load -> view('articles/one', $article, true);
		$this -> views -> menu = 'article';
		$content = $this -> views -> request_view();
		$this -> load -> view('home', $content);

	}

	public function news($id = 0) {
 
		$this -> load -> model('Views_modul', 'views');

		$this -> load -> model('Articles_modul', 'articles');

		#   $content['rubrics'] = $this -> news -> rubrics();

		$article = $this -> articles -> news($id);
 

		$this -> views -> title = $article['title'];

		# Получаем похожие новости

		
		$this -> views -> pathway = $this -> load -> view('articles/menu_pathway', '', true);

		$this -> views -> content = $this -> load -> view('articles/news', $article, true);
		$this -> views -> menu = 'article';
		$content = $this -> views -> request_view();
		$this -> load -> view('home', $content);

	}

}
